#include<iostream>
using namespace std;
const int N = 1e6 + 10;
int primes[N], cnt;
bool st[N];
int n;
void get_primes(int n)
{
	for (int i = 2; i <= n; i++) {
		if (!st[i])primes[++cnt] = i;
		for (int j = 1; primes[j] <= n / i; j++) {
			st[primes[j] * i] = 1;
			if (i % primes[j] == 0)break;
		}
	}
}
int main()
{
	get_primes(10000);
	cout << "cnt==" << cnt << endl;
	for (int i = 1; i <= cnt; i++) {
		cout << primes[i] << " ";
	}
	return 0;
}